package org.android.bbox;

import org.android.bbox.data.Profil;

import android.app.AlertDialog;
import android.app.ListActivity;
import android.app.AlertDialog.Builder;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

public abstract class AbstractActivity extends ListActivity
{
	protected Profil profil;
	public static final String DATABASE_NAME = "bbox_data.sqlite";

	public boolean onCreateOptionsMenu(Menu menu)
	{
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.menu, menu);
		return true;
	}

	public boolean onMenuItemSelected(int featureId, MenuItem item)
	{
		String current = item.toString();
		if (current.equals(getResources().getString(R.string.menu_quit)))
		{
			this.finish();
		}
		else
			if (current.equals(getResources().getString(R.string.menu_about)))
			{
				Builder builder = new AlertDialog.Builder(this);
				builder.setTitle(R.string.about);
				builder.setMessage(R.string.about_txt);
				builder.setPositiveButton("OK", null);
				builder.show();
			}

		return false;
	}
}
